package com.yy.micro.magic.data.provider;

import com.yy.micro.magic.core.model.PlanSchedule;
import com.yy.micro.magic.core.provider.impl.PlanScheduleResourceProvider;
import com.yy.micro.magic.data.domain.MagicPlanScheduleVo;
import com.yy.micro.magic.data.resource.PlanSchemeResource;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
public class DataPlanScheduleResourceProvider  extends PlanScheduleResourceProvider {

    @Autowired
    private PlanSchemeResource resource;
    @Override
    public PlanSchedule find(final String code) {
        MagicPlanScheduleVo vo =resource.findByPlanCode(code);
        if (null !=vo){
            return vo.toDomain();
        }
        return super.find(code);
    }
}
